<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>游戏统计</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="{$Think.const.RESOURCE}css/font.css">
    <link rel="stylesheet" href="{$Think.const.RESOURCE}css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="{$Think.const.RESOURCE}lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="{$Think.const.RESOURCE}js/xadmin.js"></script>
  </head>
  
  <body class="layui-anim layui-anim-fadein">
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页/游戏统计</a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:39px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" action="{:U('stats/brnn')}" method="get">
          <input class="layui-input" placeholder="时间" name="time" id="start"   value ="{$condi.time}" >
           <div class="layui-input-inline">
                <select name="gametype">
                    <option value="{$condi['gametype']}">-{$condi['gametype_name']}-</option>
                    <volist name="ct" id="gt">
                        <option value="{$gt[1]}">{$gt[0]}</option>
                    </volist>
                </select>
          </div>  
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
      </div>
      <table class="layui-table">
              <thead>
                    <tr>
                        <th colspan="4"> </th>
                        <th ><span style="display: inline-block; min-width: 60px;color: #ac8f0f;" id="Abet"> </span></th>
                        <th ><span style="display: inline-block; min-width: 60px;color: #ac8f0f;" id="Akj"> </span></th>
                        <th ><span style="display: inline-block; min-width: 60px;color: #ac8f0f;" id="Atax"> </span></th>
                        <th  style="color:#ac8f0f;" id="Aamount"> </th>
                    </tr>
                    <tr>
                        <th ><span style="display: inline-block; min-width: 60px;">时间</span></th>
                        <th> 游戏房间</th>
                        <th>登陆人数</th>
                        <th style="">登陆次数</th>
                        <th ><span style="display: inline-block; min-width: 60px;color: #ac8f0f;">总下注金额</span></th>
                        <th ><span style="display: inline-block; min-width: 60px;color: #ac8f0f;">总开奖金额</span></th>
                        <th ><span style="display: inline-block; min-width: 60px;color: #ac8f0f;">总税收</span></th>
                        <th ><span style="display: inline-block; min-width: 60px;color: #ac8f0f;">总盈亏</span></th>
                    </tr>
              </thead>
              <tbody>
                    <volist name="lists" id="vo">
                        <tr>
                            <th>{$vo.time}</th>
                            <th>{$vo.severName}</th>
                            <th>{$vo.log_peo}</th>
                            <th>{$vo.log_count}</th>
                            <th  style="color: #ac8f0f;" class="bet">{$vo.bet}</th>
                            <th  style="color: #ac8f0f;" class="kj">{$vo.kj}</th>
                            <th  style="color: #ac8f0f;" class="tax">{$vo.tax}</th>
                            <if condition="$vo.amount lt 0 ">
                                    <th  style="color:red;" class="amount">{$vo.amount}</th>
                            </if>
                             <if condition="$vo.amount eq 0 ">
                                  <th  style="color:#ac8f0f;" class="amount">{$vo.amount}</th> 
                            </if>
                            <if condition="$vo.amount gt 0 ">
                                  <th  style="color:green;" class="amount">{$vo.amount}</th> 
                            </if> 
                        </tr>
                    </volist >
              </tbody>
      </table>
    </div>
    <script>
        layui.use('laydate', function(){
            var laydate = layui.laydate;
            //执行一个laydate实例
            laydate.render({
              elem: '#start' //指定元素
            });

            //执行一个laydate实例
            laydate.render({
              elem: '#end' //指定元素
            });
        });

        $(function(){
              tax =amount=kj=bet =0;
              $(".bet").each(function(){
                  bet +=(parseInt($(this).text()));
              });
              $("#Abet").text(bet);
              
              $(".amount").each(function(){
                  amount +=(parseInt($(this).text()));
              });
              $("#Aamount").text(amount);
              
              $(".kj").each(function(){
                  kj +=(parseInt($(this).text()));
              });
              $("#Akj").text(kj);
              
              $(".tax").each(function(){
                  tax +=(parseInt($(this).text()));
              });
              $("#Atax").text(tax);
        })
    </script>
  </body>
</html>